package ru.tomsk.autovokzal;

import android.app.Activity;
import android.os.Bundle;
import android.app.*;
import android.widget.*;
import android.view.*;
import android.content.*;

public class LoginActivity extends Activity {

	private EditText login_layout_login_text_edit;
	private EditText login_layout_login_password_edit;
	private Button login_layout_login_login_button;
	private TextView login_layout_screen_header;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login);
		this.login_layout_login_text_edit = (EditText) findViewById(R.id.login_layout_login_text_edit);
		this.login_layout_login_password_edit = (EditText) findViewById(R.id.login_layout_login_password_edit);
		this.login_layout_login_login_button = (Button) findViewById(R.id.login_layout_login_login_button);
		this.login_layout_screen_header = (TextView) findViewById(R.id.login_layout_screen_header);
		this.login_layout_login_login_button
				.setOnClickListener(new View.OnClickListener() {
					public void onClick(View target) {
					}
				});
		this.login_layout_login_password_edit
				.setOnKeyListener(new View.OnKeyListener() {
					public boolean onKey(View target, int keyCode,
							KeyEvent event) {
						return true;
					}
				});
		this.login_layout_login_text_edit
				.setOnKeyListener(new View.OnKeyListener() {
					public boolean onKey(View target, int keyCode,
							KeyEvent event) {
						return true;
					}
				});

	}

	protected void onPause() {
		super.onPause();
		SharedPreferences preferences = getPreferences(MODE_PRIVATE);
		SharedPreferences.Editor editor = preferences.edit();
		editor.putString("login_layout_login_password_edit",
				login_layout_login_password_edit.getText().toString());
		editor.putString("login_layout_login_text_edit",
				login_layout_login_text_edit.getText().toString());
		editor.commit();

	}

	protected void onResume() {
		super.onResume();
		SharedPreferences preferences = getPreferences(MODE_PRIVATE);
		login_layout_login_password_edit.setText(preferences.getString(
				"login_layout_login_password_edit", ""));
		login_layout_login_text_edit.setText(preferences.getString(
				"login_layout_login_text_edit", ""));

	}

}
